#ifndef __UM_SHAREPTR_H__
#define __UM_SHAREPTR_H__

#define MALLOCSHARE(p, s, d_i) do {\
		p = sharePtr_malloc(s, d_i);\
	}while(0)

#define REFSHARE(p) do{\
	sharePtr_ref(p); \
	}while(0)

#define UNREFSHARE(p) do{\
	sharePtr_unref(p);\
}while(0)

typedef void (*onDestory)(void *p);

void * sharePtr_malloc(int s, onDestory destoryCall);
void sharePtr_ref(void *p);
void sharePtr_unref(void **p);

#endif
